﻿<UserControl x:Class="TestSL3.FileUpload"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    Width="600" Height="600">
    <StackPanel x:Name="LayoutRoot" Background="White" Margin="15" >        
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="180" />
                <ColumnDefinition Width="10" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="30" />
                <RowDefinition Height="30" />
                <RowDefinition Height="30" />
                <RowDefinition Height="30" />
                <RowDefinition Height="30" />
            </Grid.RowDefinitions>

            <TextBlock Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" TextAlignment="Right" Padding="3" Text="Character Delimiter" />
            <StackPanel Grid.Column="2" Grid.Row="0" Orientation="Horizontal" >
                <ComboBox x:Name="cbDelimiter" ToolTipService.ToolTip="The character delimiter is what seperates the data values on each line.">
                    <ComboBoxItem Content="tab" IsSelected="True" />
                    <ComboBoxItem Content="," />                    
                </ComboBox>
            </StackPanel>
            <TextBlock Grid.Column="0" Grid.Row="1" VerticalAlignment="Center" TextAlignment="Right" Padding="3" Text="Column Headers" />
            <CheckBox Grid.Column="2" Grid.Row="1" VerticalAlignment="Center" x:Name="cbColumnHeader" IsChecked="True" ToolTipService.ToolTip="Does the first line of the file have column headers? (as in, is not raw data)" />

            <TextBlock Grid.Column="0" Grid.Row="2" VerticalAlignment="Center" TextAlignment="Right" Text="Data File" />
            <StackPanel Grid.Column="2" Grid.Row="2" Orientation="Horizontal">
                <TextBox Width="320" IsEnabled="False" x:Name="tbSelectedFile" />
                <Button x:Name="btnBrowse" Content="Browse.." Click="btnBrowse_Click" />
            </StackPanel>
            <TextBlock Grid.Column="0" Grid.Row="3" VerticalAlignment="Center" TextAlignment="Right" Text="Table Name" />
            <TextBox Grid.Column="2" Grid.Row="3" x:Name="tbTableName" ToolTipService.ToolTip="The table name to query after upload. Only allowed characters [a-zA-Z0-9_]" />
            <Button Grid.Column="2" Grid.Row="4" Width="100"  Content="Upload.." x:Name="btnUpload" Click="btnUpload_Click" IsEnabled="False" />
            
            
        </Grid>

        <Grid Background="White" ShowGridLines="False">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="40"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="40"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="30" />
                <RowDefinition Height="15" />
                <RowDefinition Height="25" />
                <RowDefinition Height="15"/>
                <RowDefinition Height="25"/>
                <RowDefinition Height="15"/>
                <RowDefinition Height="25"/>
            </Grid.RowDefinitions>

            <TextBlock x:Name="txtMessage" Text="Choose File" TextAlignment="Center" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="3" Margin="5" />
            <TextBlock x:Name="txtUpload" Text="File Upload:" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3"/>            
            <ProgressBar x:Name="progressUpload" Minimum="0" Maximum="1" Grid.Column="1" Grid.Row="2" />
            <TextBlock x:Name="txtAnalyze" Text="Analyze:" Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="3"/>
            <ProgressBar x:Name="progressAnalyze" Minimum="0" Maximum="1" Grid.Column="1" Grid.Row="4" />
            <TextBlock x:Name="txtBulkInsert" Text="Data Inserted:" Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3"/>
            <ProgressBar x:Name="progressBulkInsert" Minimum="0" Maximum="1" Grid.Column="1" Grid.Row="6" />
        </Grid>

        <ScrollViewer x:Name="tbStatusScrollViewer" Margin="0 10 0 0" VerticalScrollBarVisibility="Visible" Height="100">
            <TextBox x:Name="tbStatus" TextWrapping="Wrap" IsReadOnly="True" FontSize="10" />
        </ScrollViewer>
    </StackPanel>
</UserControl>
